package cn.cdnsu.auth.listener;

import cn.cdnsu.auth.service.IPermissionScanService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class PermissonListener implements ServletContextListener {

    @Autowired
    private IPermissionScanService iPermissionScanService;
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("监听到程序启动了");
        iPermissionScanService.scan();
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {

    }
}
